<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Symbol符号</title>
</head>

<body>
  <script>
    let a = Symbol('wct');
    let c = Symbol('wct');
    console.log(a == c);
    console.log(a);
    console.log(String(c));

    let d = Symbol.for('wct');
    console.log(Symbol.keyFor(d));
    let e = Symbol.for('wct');
    console.log(Symbol.keyFor(e));
    console.log(String(d));
    console.log(d == e);
    console.log(e == c)


    const speak = Symbol();
class Person {
    [speak]() {
        console.log(123)
    }
}
let person = new Person()
console.log(person[speak]())


  </script>
</body>

</html>